package com.ayf.payment.game.api.service.impl;

import com.ayf.payment.game.api.dto.criteria.MerchantSettleRateCustomCriteria;
import com.ayf.payment.game.api.entity.platform.PaymentProduct;
import com.ayf.payment.game.api.exception.ParameterException;
import com.ayf.payment.game.api.mapper.MerchantSettleRateCustomMapper;
import com.ayf.payment.game.api.service.MerchantSettleRateCustomService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class MerchantSettleRateCustomServiceImpl implements MerchantSettleRateCustomService {

    @Resource
    private MerchantSettleRateCustomMapper merchantSettleRateCustomMapper;

    @Override
    public List<PaymentProduct> selectAll(MerchantSettleRateCustomCriteria custom) {
        if (custom.getMerchantId() == null) {
            throw new ParameterException("商户id不能为空");
        }
        return merchantSettleRateCustomMapper.selectPaymentProduct(custom);
    }
}
